<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>慢慢买</title>
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/index.css">
</head>
<body>
    <!-- 头部标签 -->
    <header>
       <a class="return" href="javascript:;">
           <!-- <span class="icon-left"></span> -->
           <div></div>
           <!-- <img src="./images/返回 (1).png" alt=""> -->
       </a>
       <span class="header-title">
           国内折扣
       </span>
        <a class="download" href="javascript:;">
            <img src="./images/header_app.png" alt="">
        </a>
    </header>
    <!-- 列表栏 -->
    <div class="box">
        <ul class="list">
            <li>
                <a href="javascript:;">
                    <img src="./images/hongzao.png" alt="">
                    <h6>西域美农新疆特产五星和田红枣250g*2</h6>
                    <span>19.8元(五件99元)</span>
                    <div>京东商城 | 10-22 13:28</div>
                </a>
            </li>
        </ul>
    </div>
    <!-- 底部标签 -->
    <footer>
      <div class="footer-title">
            <a href="javascript:;">
                    登录
                </a>
                <a href="javascript:;">
                    注册
                </a>
                <a  id="goTop" href="javascript:;">
                    <!-- <img src="./images/返回顶部.png" alt=""> -->
                    <span>返回顶部</span>
                </a>
      </div>
      <div class="footer-tools">
          <a href="javascript:;">手机APP下载</a>
          慢慢买手机版
          <span>--掌上比价平台</span>
          <h5>m.manmanbuy.com</h5>
      </div>
    </footer>
</body>
</html>
<script src="./js/jquery.min.js"></script>
<script src="./lib/template.js"></script>
<script src="./lib/jquery-1.12.4.js"></script>
<script id="listTitletmp" type="text/template">
    {{each result as val key}}
        <li>
            <a href="./buy_slowly-list.html?productid={{val.productId}}">
            {{val.productImg}}
            <h6>{{val.productName}}</h6>
            <span>{{val.productPrice}}</span>
            <div>
            <span>{{val.productFrom}}</span>
            <span>{{val.productTime}}</span>
            </div>
            </a>
        </li>
{{/each}}
</script> 
<script>

$.ajax({
    type:"get",
    url:"http://193.112.55.79:9090/api/getinlanddiscount",
    dateType:"json",
    success:function(res){
        console.log(res);       
        template.config("escape", false)
        var str = template("listTitletmp",res);
        $(".list").html(str);
    }
})
$(function(){
    $("#goTop").click(function(){
        $('html,body').stop().animate({scrollTop: 0});
    });
});
</script>